﻿<!DOCTYPE html>
<html lang="zh" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8"/>
    <title>山东营养源 - 信息详情</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta
            name="viewport"
            content="width=device-width, initial-scale=1, maximum-scale=1"
    />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
    <link rel="stylesheet" href="amis/antd.css"/>
    <link rel="stylesheet" href="amis/helper.css"/>
    <link rel="stylesheet" href="amis/iconfont.css"/>
    <style>
        html,
        body,
        .app-wrapper {
            position: relative;
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body>
<div id="root" class="app-wrapper"></div>
<script src="amis/sdk.js"></script>
<script src="Js/Tool.js"></script>
<script type="text/javascript">
    (function () {
        if (localStorage.getItem("openid") == '' || localStorage.getItem("openid") == null || localStorage.getItem("openid") == undefined) {
            localStorage.setItem("rurl", '/Detail.html?Id=' + getUrlParam('Id'));
            window.location.href = 'http://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1d304af4b2f2c6f8&redirect_uri=' + encode('http://yyywxnews.lhtuling.xyz/r.html') + '&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect'
            return;

        }

        let amis = amisRequire('amis/embed');
        // 通过替换下面这个配置来生成不同页面
        let amisJSON = {
                "type": "page",
                "body": [
                    {
                        type: "service",
                        visibleOn: "${ls:openid!=null&&ls:openid!=''}",
                        api: "/api/news/${ls:openid}/${Id}",
                        body: [
                            {
                                type: "wrapper",
                                visibleOn: "${Title!=null&&Title!=''&&Title!=undefined}",
                                body: [
                                    {
                                        type: "static",
                                        className: "text-center text-2xl",
                                        tpl: "<div>${Title}</div>"
                                    },
                                    {
                                        type: "static",
                                        className: "text-center text-xs",
                                        tpl: "<div><span class='mr-2'>类别：${Class.ClassName}</span><span>添加日期：${CreateTime}</span></div>"
                                    },
                                    {
                                        type: "static",
                                        className: "text-left bg-white rounded-xl p-2 overflow-auto",
                                        tpl: "${Content|raw}"
                                    },
                                    {
                                        "type": "card",
                                        "header": {
                                            "title": "附件列表"
                                        },
                                        "body": {
                                            "type": "each",
                                            "source": "${Files|split}",
                                            "items": {
                                                "type": "tpl",
                                                "tpl": "<div><a target='_blank' href='${item}' class='mb-1 '>${index+1}：${item|split:/|last}</a></div>"
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ;
        let amisScoped = amis.embed('#root', amisJSON, {}, {theme: 'antd'});
    })
    ();
</script>
</body>
</html>